package com.ctshk.common.enums;

/**
 * <p>
 *     机票旅客类型
 * </p>
 * @author lihang
 * @since 2021-03-18
 */
public enum TrainTouristType {

    ADULT(1, "成人"),
    CHILD(2, "小童"),
    /*BABY(3, "嬰兒"),
    BUSINESS(4, "差旅"),
    SERVANT(5,"傭工"),
    STUDENT(6,"學生"),
    WORKHOLIDAY(7,"工作假期"),*/;

    private Integer type;
    private String name;

    TrainTouristType(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static TrainTouristType get(Integer type){
        for (TrainTouristType value : TrainTouristType.values()) {
            if(value.getType().intValue()==type.intValue()){
                return  value;
            }
        }
        return  null;
    }
}
